package route

import (
	"net/http/pprof"

	"github.com/go-kratos/kratos/v2/transport/http"
)

func registerPprof(hs *http.Server) {
	hs.HandleFunc("/debug/pprof", pprof.Index)
	hs.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
	hs.HandleFunc("/debug/pprof/profile", pprof.Profile)
	hs.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
	hs.HandleFunc("/debug/pprof/trace", pprof.Trace)
	hs.HandleFunc("/debug/allocs", pprof.Handler("allocs").ServeHTTP)
	hs.HandleFunc("/debug/block", pprof.Handler("block").ServeHTTP)
	hs.HandleFunc("/debug/goroutine", pprof.Handler("goroutine").ServeHTTP)
	hs.HandleFunc("/debug/heap", pprof.Handler("heap").ServeHTTP)
	hs.HandleFunc("/debug/mutex", pprof.Handler("mutex").ServeHTTP)
	hs.HandleFunc("/debug/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
}
